package com.itheima.io1.mytest;

import java.io.*;

/**
 * @author zhangbaiyan
 * @date 2024-09-20 22:13
 * @description:
 * @version:
 */
public class test3 {
    public static void main(String[] args) throws IOException {
        //创建缓冲流对象
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(new File(".txt")));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File("a.txt")));

        //拷贝(一次读写多个字节)
        byte[] bytes = new byte[1024];
        int len;
        while ((len = bis.read(bytes))!=-1){
            bos.write(bytes,0,len);
        }
        //释放资源
        bos.close();
        bis.close();

    }
}
